﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace EventManager.ViewModels
{
    public class EventViewModel
    {
        public Guid Id { get; set; }

        [Required(ErrorMessage = "Name field is very required.")]
        [DisplayName("Name: ")]
        [Remote("ValidateName", "Events", ErrorMessage = "Pleas correct name.")]
        public string Name { get; set; }

        [Required]
        [DisplayName("Description: ")]
        public string Description { get; set; }

        [Required]
        [DataType(DataType.Time)]
        [RegularExpression(@"\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}", ErrorMessage = "Date is invalid")]
        [DisplayName("Start date: ")]
        public DateTime StartDate { get; set; }

        [Required]
        [DataType(DataType.Time)]
        [RegularExpression(@"\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}", ErrorMessage = "Date is invalid")]
        [DisplayName("End date: ")]
        public DateTime EndDate { get; set; }

        public IEnumerable<CategoryViewModel> Categories { get; set; }

        public IEnumerable<Guid> SelectedCategories { get; set; }
    }
}